﻿using J.Model;
using J.ProductGet.Application.Command.ReservationinformationtableCommand;
using MediatR;
using SqlSugar;

namespace J.ProductGet.Application.CommandHandler.ReservationinformationtableCommandHandler
{
    public class RESERVATIONINFORMATIONTABLEGetCommandHandler : IRequestHandler<RESERVATIONINFORMATIONTABLEGetCommand, List<RESERVATIONINFORMATIONTABLE>>
    {
        private readonly ISqlSugarClient _sqlSugarClient;
        public RESERVATIONINFORMATIONTABLEGetCommandHandler(ISqlSugarClient sqlSugarClient)
        {
            _sqlSugarClient = sqlSugarClient;
        }
        public async Task<List<RESERVATIONINFORMATIONTABLE>> Handle(RESERVATIONINFORMATIONTABLEGetCommand request, CancellationToken cancellationToken)
        {
            return await _sqlSugarClient.Queryable<RESERVATIONINFORMATIONTABLE>().ToListAsync();
        }
    }
}
